// import Vue from 'vue';
import { getLocalUserInfo,removeLocalUserInfo } from "@/assets/common/js/global";
import { cachestroeGet,cachestroeRemove } from '@/api/login.js';
import {Notification} from "element-ui";
import router from '../../../../router'

export function checkLogin(){

    cachestroeGet('userInfo').then(res=>{
        if (res.code === 200) {
            if(!res.data){
                Notification.closeAll()
                Notification({
                    message: '未登录!',
                    type: "error",
                    duration: 3 * 1000,
                    showClose:true,
                    customClass:'customNotifyClass'
                });
                router.replace('/login');
            }
        }
    })
}
